<?php
namespace Amis\form;
class LocationPicker extends FormItem
{
    public string $type   = 'location-picker';
    public $vendor = 'baidu';

    /**
     *    百度地图的 ak
     * @param string $ak
     * @return $this
     */
    public function ak(string $ak)
    {
        $this->ak = $ak;
        return $this;
    }

    /**
     * 输入框是否可清空
     * @param bool $clearable
     * @return $this
     */
    public function clearable(bool $clearable = false)
    {
        $this->clearable = $clearable;
        return $this;
    }

    /**
     * 默认提示
     * @param string $placeholder
     * @return $this
     */
    public function placeholder(string $placeholder = '请选择位置')
    {
        $this->placeholder = $placeholder;
        return $this;
    }

    /**
     * 默为百度坐标，可设置为'gcj02'
     * @param string $coordinatesType
     * @return $this
     */
    public function coordinatesType(string $coordinatesType = 'bd09')
    {
        $this->coordinatesType = $coordinatesType;
        return $this;
    }
}